package com.example.oop.POJO;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "chess_play")
public class ChessPlay {
    @Id
    private Integer id;

    private int status; //对局状态(1-正在对局， 2-对局结束)

    private String turn;  //回合，使用用户名进行区别

    private String chessResult;  //对局最终结果

    private String winner; //获胜者，使用用户名进行区别

    private String player1Name;

    private String player2Name;

    public ChessPlay(Integer id, int status, String turn) {//该构造函数在beginPlay中使用
        this.id = id;
        this.status = status;
        this.turn = turn;
        this.chessResult = "0000000000000000000000000000000000000000000000" +
                "000000000000000000000000000000000000000000000000000000000000" +
                "000000000000000000000000000000000000000000000000000000000000" +
                "00000000000000000000000000000000000000000000000000000000000";
    }
}
